package com.tedu.api;


import org.junit.Test;

public class 作业 {
    @Test
    public void testLength() {

        String str = "HelloJava";//10
        System.out.println(str.length());
    }

    @Test
    public void testIndexOf() {
        String str = "HelloJava";
        int index = str.indexOf("o");
        System.out.println("o的位置：" + index);

    }

    @Test
    public void testIndexOf1(){
        String str = "HelloJava";
        int index = str.indexOf("o", 5);
        System.out.println(index);
    }
    @Test
    public void testSubString(){
        String url="HelloJava";
        url=url.substring(0,5);
        System.out.println("截取子字符串"+url);
    }
    @Test
    public void testSubString1(){
        String url="HelloJava";
        url=url.substring(5);
        System.out.println("截取子字符串"+url);
    }
    @Test
    public void testTrim(){
        String str=" Hello ";
        str=str.trim();
        System.out.println("去掉两边空格："+str);
    }
    @Test
    public void testChatAt() {
        String str = "HelloJava";
        char character = str.charAt(5);
        System.out.println(character);
    }
    @Test
    public void testTrim1(){
        String str="HelloJava";
        str=str.trim().toLowerCase();
        System.out.println("小写"+str);
        str=str.toUpperCase();
        System.out.println("大写"+str);
    }
}






